﻿@page "/CustomState"
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Authorization
@attribute [Authorize]

<h3>@AuthState?.User?.Identity?.Name</h3>
<hr />
<p>
    <h4>点赞：<strong>@AuthState?.IsLike</strong></h4>
</p>
<p>
    <h4>投币：<strong>@AuthState?.Coining</strong>枚</h4>
</p>

@code {
    [CascadingParameter]
    private Task<AuthenticationState>? authenticationState { get; set; }

    AuthState? AuthState;

    protected override async Task OnInitializedAsync()
    {
        AuthState = authenticationState?.Result as AuthState;
    }
}